//
//  BarChartViewController.m
//  饼线柱状图
//
//  Created by ma c on 9/8/18.
//  Copyright © 2018年 子房. All rights reserved.
//

#import "BarChartViewController.h"
#import "SSWBarChartView.h"

@interface BarChartViewController ()

@end

@implementation BarChartViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self makeTheBar];
}

-(void)makeTheBar
{
    SSWBarChartView * barCharView = [[SSWBarChartView alloc] initWithChartType:SSWChartsTypeBar];
    barCharView.backgroundColor = [UIColor orangeColor];
    barCharView.xValuesArr = [@[@"小麦",@"玉米",@"早籼稻",@"旱籼稻",
                                @"大豆",@"小豆",@"小米",@"大米",
                                @"菜籽",@"芝麻",@"高粱",@"甘蔗",
                                @"豌豆",@"红豆",@"绿豆",@"青稞"] mutableCopy];
    barCharView.yValuesArr = [@[@"100",@"200",@"300",@"60",
                                @"460",@"368",@"235",@"222",
                                @"100",@"200",@"300",@"500",
                                @"136",@"366",@"350",@"450"] mutableCopy];
    barCharView.unit = @"吨";
    barCharView.yScaleValue = 60;
    barCharView.frame = CGRectMake(0, 100, self.view.bounds.size.width, 300);
    [self.view addSubview:barCharView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
